package com.hmh.student.system.result;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
    @NoArgsConstructor
    @AllArgsConstructor
    public class Result implements Serializable {
        private Boolean success;
        private String message;
        private Object data;

        public static Result success() {
            return new Result(true, null, null);
        }

        public static Result success(Object data) {
            return new Result(true, null, data);
        }

        public static Result success(String message, Object data) {
            return new Result(true, message, data);
        }

        public static Result fail(String message) {
            return new Result(false, message, null);
        }
    }

